package no.sachmuld.methodcombination.examples.annotation.designbycontract.courier;


import no.sachmuld.aspectjattach.AspectJAgent;

import java.lang.*;

/**
 *
 */
public class Main implements Runnable {

    @Override
    public void run() {

        Main.class.getClassLoader().setDefaultAssertionStatus(true);
        AspectJAgent.initializeIfNeeded();

        new Runnable() {

            @Override
            public void run() {

                Courier[] couriers = {
                        new Courier(),
                        new CourierWithBetterService()
                };

                for (Courier courier : couriers) {
                    Delivery delivery = courier.deliver(new Package(1));
                    System.out.println(delivery);
                }

            }

        }.run();

    }

    public static void main(String... args) throws NoSuchMethodException {

        new Main().run();

    }

}
